#ifndef LOG_DRIVER_H
#define LOG_DRIVER_H

#include <fltKernel.h>
#include <dontuse.h>
#include <suppress.h>
#include <ntddscsi.h>		

#pragma prefast(disable:__WARNING_ENCODE_MEMBER_FUNCTION_POINTER, "Not valid for kernel mode drivers")

#define MINISPY_PORT_NAME								L"\\NPMiniPort"


/*************************************************************************
    Prototypes
*************************************************************************/

#ifdef __cplusplus
extern "C"{
#endif
	NTSTATUS NPUnload(
		__in FLT_FILTER_UNLOAD_FLAGS Flags);

	FLT_PREOP_CALLBACK_STATUS
		NPPreCreate (
		__inout PFLT_CALLBACK_DATA Data,
		__in PCFLT_RELATED_OBJECTS FltObjects,
		__deref_out_opt PVOID *CompletionContext
		);
	FLT_POSTOP_CALLBACK_STATUS
		PtPostOperationPassThrough (
		__inout PFLT_CALLBACK_DATA Data,
		__in PCFLT_RELATED_OBJECTS FltObjects,
		__in_opt PVOID CompletionContext,
		__in FLT_POST_OPERATION_FLAGS Flags
		);
	BOOLEAN NPUnicodeStringToChar(PUNICODE_STRING UniName, char Name[]);
	NTSTATUS
		NPMiniConnect(
		__in PFLT_PORT ClientPort,
		__in PVOID ServerPortCookie,
		__in_bcount(SizeOfContext) PVOID ConnectionContext,
		__in ULONG SizeOfContext,
		__deref_out_opt PVOID *ConnectionCookie
		);
	VOID
		NPMiniDisconnect(
		__in_opt PVOID ConnectionCookie
		);
	NTSTATUS
		NPMiniMessage (
		__in PVOID ConnectionCookie,
		__in_bcount_opt(InputBufferSize) PVOID InputBuffer,
		__in ULONG InputBufferSize,
		__out_bcount_part_opt(OutputBufferSize,*ReturnOutputBufferLength) PVOID OutputBuffer,
		__in ULONG OutputBufferSize,
		__out PULONG ReturnOutputBufferLength
		);

#ifdef __cplusplus
}
#endif
            
#pragma alloc_text(PAGE, NPMiniMessage)    			//for port comunication		

//  operation registration
const FLT_OPERATION_REGISTRATION Callbacks[] = {
    { IRP_MJ_CREATE,
      0,
	  NPPreCreate,
      PtPostOperationPassThrough},

    { IRP_MJ_OPERATION_END }
};

//  This defines what we want to filter with FltMgr
const FLT_REGISTRATION FilterRegistration = {

    sizeof( FLT_REGISTRATION ),         //  Size
    FLT_REGISTRATION_VERSION,           //  Version
    0,                                  //  Flags

    NULL,                               //  Context
    Callbacks,                          //  Operation callbacks

    NPUnload,                           //  MiniFilterUnload

    NULL,								//  InstanceSetup
    NULL,								//  InstanceQueryTeardown
    NULL,								//  InstanceTeardownStart
    NULL,								//  InstanceTeardownComplete

    NULL,                               //  GenerateFileName
    NULL,                               //  GenerateDestinationFileName
    NULL                                //  NormalizeNameComponent

};

#endif